package org.jivesoftware.smackx.workgroup.util;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

public final class ModelUtil
{
  public static final boolean areBooleansDifferent(Boolean paramBoolean1, Boolean paramBoolean2)
  {
    int i;
    if (areBooleansEqual(paramBoolean1, paramBoolean2))
      i = 0;
    while (true)
    {
      return i;
      i = 1;
    }
  }

  public static final boolean areBooleansEqual(Boolean paramBoolean1, Boolean paramBoolean2)
  {
    int i;
    if ((((paramBoolean1 != Boolean.TRUE) || (paramBoolean2 != Boolean.TRUE))) && (((paramBoolean1 == Boolean.TRUE) || (paramBoolean2 == Boolean.TRUE))))
      i = 0;
    while (true)
    {
      return i;
      i = 1;
    }
  }

  public static final boolean areDifferent(Object paramObject1, Object paramObject2)
  {
    int i;
    if (areEqual(paramObject1, paramObject2))
      i = 0;
    while (true)
    {
      return i;
      i = 1;
    }
  }

  public static final boolean areEqual(Object paramObject1, Object paramObject2)
  {
    boolean bool;
    if (paramObject1 == paramObject2)
      bool = true;
    while (true)
    {
      while (true)
      {
        return bool;
        if ((paramObject1 != null) && (paramObject2 != null))
          break;
        bool = false;
      }
      bool = paramObject1.equals(paramObject2);
    }
  }

  public static final String concat(String[] paramArrayOfString)
  {
    return concat(paramArrayOfString, " ");
  }

  public static final String concat(String[] paramArrayOfString, String paramString)
  {
    StringBuilder localStringBuilder;
    int j;
    String str2;
    if (paramArrayOfString != null)
    {
      localStringBuilder = new StringBuilder();
      int i = paramArrayOfString.length;
      j = 0;
      if (j >= i)
      {
        int k = localStringBuilder.length();
        if (k > 0)
          localStringBuilder.setLength(k - 1);
        str2 = localStringBuilder.toString();
      }
    }
    while (true)
    {
      while (true)
      {
        return str2;
        String str1 = paramArrayOfString[j];
        if (str1 != null)
          localStringBuilder.append(str1).append(paramString);
        ++j;
      }
      str2 = "";
    }
  }

  public static String getTimeFromLong(long paramLong)
  {
    new Date();
    (paramLong / 86400000L);
    long l1 = paramLong % 86400000L;
    long l2 = l1 / 3600000L;
    long l3 = l1 % 3600000L;
    long l4 = l3 / 60000L;
    long l5 = l3 % 60000L;
    long l6 = l5 / 1000L;
    (l5 % 1000L);
    StringBuilder localStringBuilder = new StringBuilder();
    if (l2 > 0L)
      localStringBuilder.append(l2 + " " + "h" + ", ");
    if (l4 > 0L)
      localStringBuilder.append(l4 + " " + "min" + ", ");
    localStringBuilder.append(l6 + " " + "sec");
    return localStringBuilder.toString();
  }

  public static final boolean hasLength(String paramString)
  {
    int i;
    if ((paramString != null) && (paramString.length() > 0))
      i = 1;
    while (true)
    {
      return i;
      i = 0;
    }
  }

  public static final boolean hasNonNullElement(Object[] paramArrayOfObject)
  {
    int j;
    int k;
    if (paramArrayOfObject != null)
    {
      j = paramArrayOfObject.length;
      k = 0;
    }
    while (true)
    {
      int i;
      if (k >= j)
        i = 0;
      while (true)
      {
        return i;
        if (paramArrayOfObject[k] == null)
          break;
        i = 1;
      }
      ++k;
    }
  }

  public static boolean hasStringChanged(String paramString1, String paramString2)
  {
    int i;
    if ((paramString1 == null) && (paramString2 == null))
      i = 0;
    while (true)
    {
      while (true)
      {
        while (true)
        {
          return i;
          if ((((paramString1 != null) || (paramString2 == null))) && (((paramString1 == null) || (paramString2 != null))))
            break;
          i = 1;
        }
        if (!(paramString1.equals(paramString2)))
          break;
        i = 0;
      }
      i = 1;
    }
  }

  public static List iteratorAsList(Iterator paramIterator)
  {
    ArrayList localArrayList = new ArrayList(10);
    while (true)
    {
      if (!(paramIterator.hasNext()))
        return localArrayList;
      localArrayList.add(paramIterator.next());
    }
  }

  public static final String nullifyIfEmpty(String paramString)
  {
    String str;
    if (hasLength(paramString))
      str = paramString;
    while (true)
    {
      return str;
      str = null;
    }
  }

  public static final String nullifyingToString(Object paramObject)
  {
    String str;
    if (paramObject != null)
      str = nullifyIfEmpty(paramObject.toString());
    while (true)
    {
      return str;
      str = null;
    }
  }

  public static Iterator reverseListIterator(ListIterator paramListIterator)
  {
    return new ReverseListIterator(paramListIterator);
  }
}